﻿using UnityEngine;
using System.Collections;

public class FX_ParticleDelayTime : MonoBehaviour
{
	public float DelayTime = 1.0f;
	private float _cur_time = 0f;

	void Awake()
	{
		foreach( var child in GetComponentsInChildren<ParticleSystem>() )
			child.Stop();
	}


	void Start()
	{

	}

	void Update()
	{
		if( _cur_time > DelayTime )
		{
			foreach( var child in GetComponentsInChildren<ParticleSystem>() )
				child.Play();
			enabled = false;
			return;
		}
		_cur_time += Time.deltaTime;
	}
}
